package com.skt.common_hr.biztrip_sac.renderer
{
	import mx.containers.HBox;
	import mx.controls.Label;
	import mx.controls.dataGridClasses.DataGridListData;
	import mx.controls.listClasses.BaseListData;
	import mx.controls.listClasses.IDropInListItemRenderer;

	public class AppStatusItemRenderer extends HBox implements IDropInListItemRenderer
	{
		public function AppStatusItemRenderer(){
			super();
			this.setStyle("verticalAlign","middle");
			//this.setStyle("backgroundColor","#ffffff");
			//this.alpha = 0;
			this.buttonMode = true;
			this.mouseChildren = false;
			this.useHandCursor = true;
			this.horizontalScrollPolicy = "off";
		} 

		private var _listData:DataGridListData;
		private var lb:Label;
		public function get listData():BaseListData
		{
		  	return _listData;
		}
		public function set listData(value:BaseListData):void
		{
			_listData = DataGridListData(value);
		}

		override protected function createChildren():void
		{
			super.createChildren();
			lb = new Label();
			lb.percentWidth = 100;
			this.addChild(lb);
		}

		override public function set data(value:Object):void{
			super.data = value;
			if(value == null) return;
			lb.text = value[_listData.dataField];
			if(value.TRSTATUS == "14" || value.TRSTATUS == "24") {	// 일정 반려, 품의 반려
				this.setStyle("color","#ff0000");
			}
			else {
				this.setStyle("color","#000000");
			}
			super.invalidateDisplayList();
		}
	}
}